package rs.networx.entity;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="friend_requests")
public class FriendRequest implements java.io.Serializable {

	private static final long serialVersionUID = -1805162367L;

	@Id
	@GeneratedValue(strategy=IDENTITY)
	@Column(name="friend_request_id", unique=true, nullable=false)
	private Integer Id;

	@Column(name="date", unique=false, nullable=false)
	private Date date;

	@Column(name="status", unique=false, nullable=false)
	private Integer status;

	@ManyToOne
	@JoinColumn(name="request_from_id", referencedColumnName="person_id", nullable=false)
	private Person requestFrom;

	@ManyToOne
	@JoinColumn(name="request_to_id", referencedColumnName="person_id", nullable=false)
	private Person requestTo;

	public FriendRequest() {
	}

	public Integer getId() {
		return Id;
	}

	public void setId(Integer id) {
		Id = id;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Person getRequestFrom() {
		return requestFrom;
	}

	public void setRequestFrom(Person requestFrom) {
		this.requestFrom = requestFrom;
	}

	public Person getRequestTo() {
		return requestTo;
	}

	public void setRequestTo(Person requestTo) {
		this.requestTo = requestTo;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public String toString() {
		return "FriendRequest" + " Id=" + Id + " date=" + date + " status="
				+ status;
	}

}